/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ufps.cuatro.modelo.biblioteca;

import com.ufps.cuatro.util.base.ObjectBase;

/**
 *
 * @author Catc
 */
public class ItemStaticListModelObject extends ObjectBase{
    private static final long serialVersionUID = -3383635604108475432L;
    
    private Object obj;
    private String name;

    public ItemStaticListModelObject() {
    }

    public ItemStaticListModelObject(Object obj) {
        this.obj = obj;
        name = obj.toString();
    }

    public ItemStaticListModelObject(Object obj, String name) {
        this.obj = obj;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    @Override
    public String toString() {
        return name;
    }

    @Override
    public int compareTo(Object o) {
       try{
            ItemStaticListModelObject p = (ItemStaticListModelObject) o;
            return name.compareTo(p.getName());
        }catch(java.lang.NullPointerException ex){}
       return 0;
    }
    
    
    
}
